 /*
  * Copyright (c) 2021, 2023, yishun.cn All rights reserved.
  *
  */
 package com.hmdp.config;

 import com.hmdp.utils.LoginInterceptor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

 import javax.annotation.Resource;

 /**
  * <p>Project: hm-dianping-com.hmdp.config-MvcConfig
  * <p>Powered by yishun On 2023-02-18 15:37:59
  *
  * @author yishun [2465734101@qq.com]
  * @version 1.0
  * @since 17
  */
 @Configuration
 public class MvcConfig implements WebMvcConfigurer {
     @Resource
     private StringRedisTemplate stringRedisTemplate;
     @Override
     public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(new LoginInterceptor(stringRedisTemplate))
                 .excludePathPatterns(
                         "/shop/**",
                         "/shop-type/**",
                         "/voucher/**",
                         "/upload/**",
                         "/blog/hot",
                         "/user/code",
                         "/user/login"

                 );
     }
 }
